<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var num1 = 123
    var age = 18
    var isAdmin = true

    // 隐式转换
    var num1Str = num1 + ""
    var ageStr = age + ""
    var isAdminStr = isAdmin + ""
    console.log(num1Str, ageStr, isAdminStr)
    console.log(typeof num1Str, typeof ageStr, typeof isAdminStr)
    // 显式转换
    var num1Str2 = String(num1)
    console.log(num1Str2, typeof num1Str2)
    

  </script>
</body>

</html>